<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8>
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <title>{cscms:title}</title>
    <meta name="Keywords" content="{cscms:keywords}" />
    <meta name="Description" content="{cscms:description}" />
    <link rel="stylesheet" href="{cscms:webpath}packs/font/font.css">
    <link rel="stylesheet" type="text/css" href="{cscms:indextempurl}css/user.css" />
    <script type='text/javascript' src='{cscms:indextempurl}js/user.js'></script>
    <style type="text/css">
    .layui-form-checkbox[lay-skin=primary]{margin-top: 0px}
    .layui-form-checkbox span{padding: 0px}
    </style>
</head>
<body style="background: #f5f5f5">
    {cscms:indexhead}
    {cscms:indexright}
        {cscms:indexleft}
            <div class="sp-cont-r" style="overflow: visible;">
                <div class="layui-tab layui-tab-card" lay-filter="dt1" style="margin-top: 0px;margin-bottom: 0px">
                    <ul class="layui-tab-title" style="height: 41px">
                        <li class="layui-this"><a href="javascript:;">上传图片</a></li>
                        <li><a href="[user:url userlink=pic,type]">已通过相册</a></li>
                        <li><a href="[user:url userlink=pic,verify]">审核中相册</a></li>
                        <li><a href="[user:url userlink=pic]">我的图片</a></li>
                        <a style="float: right;margin-right: 15px;margin-top: 5px" href="[user:url userlink=pic,add]" class="layui-btn layui-btn-small layui-btn-danger">上传图片</a>
                        <a style="float: right;margin-right: 15px;margin-top: 5px" href="[user:url userlink=pic,addtype]" class="layui-btn layui-btn-small layui-btn-danger">制作相册</a>
                    </ul>
                    <div class="layui-tab-content" style="padding:10px;background-color: #fff">
                        <div class="layui-tab-item layui-show">
                        <form class="layui-form layui-form-pane" action="[user:picsave]" method="post">
                            <div class="layui-form-item">
                                <label class="layui-form-label">所属分类</label>
                                <div class="layui-input-block">
                                    <select name="cid" id="cid">
                                    {cscms:class table="pic_list" fid="0" sort="xid" order="asc"}
                                        <option value="[class:id]">&nbsp;|—[class:name]</option>
                                        {cscmstype:class2 table="pic_list" fid="auto" sort="xid" order="asc"}
                                        <option value="[class2:id]">&nbsp;|&nbsp;&nbsp;&nbsp;|—[class2:name]</option>
                                        {/cscmstype:class2}
                                    {/cscms:class}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">所属相册</label>
                                <div class="layui-input-block">
                                    <input id="sid" name="sid" type="hidden" value="[pic:sid]">
                                    <input type="text" name="name" id="name" readonly="true" onclick="cscms.get_open('[user:url userlink=pic,res]/[pic:sid]','选择相册','658px','520px');" required lay-verify="required" value="[pic:name]" class="layui-input">
                                </div>
                            </div>
                            {cscms:opt_field_pic}
                            <input type="hidden" name="token" value="[user:token]"/>
                            <div class="layui-form-item">
                                <div class="layui-input-block" style="text-align: center;margin-left: 0px">
                                    <a style="" class="layui-btn" href="javascript:uploadPic()">上传图片</a>
                                </div>
                            </div>
                        </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="mar10"></div>
    <div class="mar10"></div>
{cscms:indexbottom}
<script type="text/javascript">
    $(document).ready(function() {
        $('#left_pic_2').addClass('on');
        $('#left_first').removeClass('layui-nav-itemed');
        $('#left_pic_2').parent().parent().addClass('layui-nav-itemed');
    });
    function uploadPic(){
        var sid = $('#sid').val();
        var cid = $('#cid').val();
        if(sid!='' && sid!=0){
            cscms.get_open('{cscms:path}index.php/pic/user/picadd?dir=pic&fid=zpic&type=*.jpg;*.png;*.gif&sid='+sid+'&nums=10&cid='+cid,'上传图片','500px','360px');
        }else{
            cscms.layer.msg('请先选择相册',{icon:2});
        }
    }
</script>
</body>
</html>